package heima_bixiangdong.test.review1;

/**
 * @DESCRIPTION:
 * @USER: shg
 * @DATE: 2022/11/26 13:30
 */
public class Bank {

    private int totalMoney;
    private Object object = new Object();
    public void add(int money){
        synchronized (object){
            totalMoney = totalMoney+money;
            System.out.println(Thread.currentThread().getName()+"..."+totalMoney);
        }
    }
}
